(function() {
    var myApp = angular.module('myApp');

    myApp.constant("myTableOption", {
        dom        : 'ftir',
        processing : true,
        serverSide : true,
        deferRender: true,
        scrollY    : '100%',
        scroller   : true,
        select     : true,
        searchDelay: 1000,
        language   : { url: '../../pub/datatables/zh_cn.json' },
        columns    : [
            { data: 'name' 	},
            { data: 'descr' },
            {
                data: 'status',
                render : function ( data, type, row, meta ) {
                    return data == 1 ? '启用' : '禁用';
                }
            }
        ]
    });

    myApp.constant("myRoleTableOption", {
        dom        : 'ftir',
        processing : true,
        serverSide : true,
        deferRender: true,
        scrollY    : '100%',
        scroller   : true,
        select     : true,
        searchDelay: 1000,
        order      : [],
        language   : { url: '../../pub/datatables/zh_cn.json' },
        columns    : [
            {
                orderable: false,
                render : function ( data, type, row, meta ) {
                    return '<input type="checkbox">';
                }
            },
            { data: 'name'   },
            { data: 'descr'  },
            {
                data: 'status',
                render : function ( data, type, row, meta ) {
                    return data == 1 ? '启用' : '禁用';
                }
            }
        ]
    });

    myApp.constant("myPermissionOption", {
        dom        : 'ftir',
        processing : true,
        serverSide : true,
        deferRender: true,
        scrollY    : '100%',
        scroller   : true,
        select     : true,
        searchDelay: 1000,
        order      : [[0, 'desc']],
        language   : { url: '../../pub/datatables/zh_cn.json' },
        columns    : [
            {
                data: 'selected',
                searchable: false,
                className: 'select-checkbox',
                render : function ( data, type, row, meta ) {
                    return '';
                }
            },
            { data: 'name'   },
            { data: 'descr'  },
            {
                data: 'status',
                render : function ( data, type, row, meta ) {
                    return data == 1 ? '启用' : '禁用';
                }
            }
        ]
    });

})();